<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String path = request.getContextPath();
%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<html:html locale="true">
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<title></title>
<link href="console.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {font-size: 16px}
-->
.even {
	background:	#eee;
}

.odd {

}
</style>
</head>

<body>
<jsp:include page="/title.jsp" flush="true"/>
	<p class="lnkhead2"><bean:message key="menu.messages"/>&gt;<bean:message key="menu.messageDefinitions"/></p>
	<form name="form" method="post" action="message.do">
	<input type="hidden" name="act"/>
	  <table width="100%" border="0" cellpadding="1" class="sort-table" id="table-1" cellspacing="0">
	
	<thead>
			
			<tr >
			<td align="center">&nbsp;</td>
				
				
				<td align="center" width="15%">
					
					<bean:message key="message.id"/>
					
				</td>
				
				
				<td align="center" width="45%">
					
					<bean:message key="heading.desc"/>
					
				</td>
				
				<td align="center" width="25%">
					
					<bean:message key="heading.createDate"/>
					
				</td>
				<td align="center" width="25%">
					
					<bean:message key="heading.updateDate"/>
					
				</td>
				
				
			 
			</tr>
	  </thead>
			<tbody>
			<% int i=0; String color;String check="";%>
			
			<logic:iterate id="attr" name="list">
				
				<% i++; if(i%2==1) color="odd"; else color="even"; if(i==1) check="checked"; else check="";%>
				
				<tr  class="<%=color%>">
					<td align="center">
					<input type="radio" <%=check%> name="id"  value="<bean:write name='attr' property='id'/>" />
								
					</td>
					
					<td align="left">
					<bean:write name="attr" property="id"/>
					</td>
					<td align="center">
						<bean:write name="attr" property="desc"/>
						
					</td>
					
					<td align="center">
							<bean:write format="yyyy-MM-dd HH:mm" name="attr" property="createDate" />
					</td>
				<td align="center">
							<bean:write format="yyyy-MM-dd HH:mm" name="attr" property="updateDate" />
					</td>
				</tr>
			
			</logic:iterate>
	  </tbody>
</table>
	<table width="100%">		
			<tr >
				
				<td align="left">
					<input  type="button" name="Submit" value="<bean:message key="button.add"/>" onclick="javascript:add()"/>
					<input  type="button" name="Submit1" value="<bean:message key="button.update"/>" onclick="javascript:update()"/>
					<input  type="button" name="Submit2" value="<bean:message key="button.delete"/>" onclick="javascript:del()"/>
					<input  type="button" name="uploadProcess" value="<bean:message key="button.upload"/>" onclick="javascript:upload1()">
					<input  type="button" name="downloadProcess" value="<bean:message key="button.download"/>" onclick="javascript:download()">
				</td>
			</tr>
</table>
			
	</form>
	<div id="upload_div"  style="visibility:hidden; z-index:2" >
		<form name="form1" enctype="multipart/form-data" method="post" action="message.do">
 		<table width="50%" border="0" cellpadding="0"  cellspacing="0">
		<tr  class="txtnormal2">	
		<td>		
 <input type="file" name="file">
 </td>
			
				<td>
				<input type="hidden" name="act" value="upload"/>
			<input  type="button" name="Submit" value="<bean:message key="button.upload"/>" onclick="javascript:upload()">
			</td>
	</tr>
</table>
</form>
	</div>

	<script  language="JavaScript">
	
function add()
	{
	var frm = document.forms["form"];
	frm.elements["act"].value="newMessage";
	frm.submit();
	}
	function update()
	{
	var frm = document.forms["form"];
	frm.elements["act"].value="queryMessageDetail";
	frm.submit();
	};
	function del()
	{
	var frm = document.forms["form"];
	var typeId=(selectedRadiobox(frm,"id"));
	if( !confirm("<bean:message key='button.confirmDelete'/>"+"<bean:message key='message.id'/>:"+typeId)) return;
	frm.elements["act"].value="deleteMessage";
	frm.submit();
	 }
	 function download(){
	var frm = document.forms["form"];
	frm.elements["act"].value="download";
	frm.submit();
	}
	 
	 function upload(){
	var frm = document.forms["form1"];
	if(frm.elements["file"].value==""){
	alert("<bean:message key='button.mustSelectFile'/>");
	return;
	}
	frm.submit();
	}
	function upload1(){
	 shift_visibility(upload_div);
	 
	 }
	 function shift_visibility(image1){
 if(image1.style.visibility == "visible")
  image1.style.visibility = "hidden";
  else  image1.style.visibility = "visible";
};
	 </script>
	 
	 			<script type="text/javascript">
var st = new SortableTable(document.getElementById("table-1"),
	["None", "String","String",  "String","String"]);
</script>
<logic:notEmpty name="returnMsg">
	<script>
	alert('<bean:write name="returnMsg"/>');
	</script>
	</logic:notEmpty>
<%@ include file="/table_bottom.jsp" %>
</body>
</html:html>



